package com.nextlink.chinesechess
/**
 * Created by IntelliJ IDEA.
 * User: box.cai
 * Date: 2009-5-25
 * Time: 11:33:51
 * To change this template use File | Settings | File Templates.
 */

public class Piece {
    static final tBin = 'bin'
    static final tJu = 'ju'
    static final tMa = 'ma'
    static final tPao = 'pao'
    static final tShi = 'shi'
    static final tXiang = 'xiang'
    static final tJiang = 'jiang'
    static final Type = [tBin, tJu, tMa, tPao, tXiang, tShi, tJiang]

    static final cBlack = 'black'
    static final cRed = 'red'
    static final Color = [cRed, cBlack]

    private int typeIndex
    private int colorIndex
    int x,y

    Piece(String t, String c) {
        typeIndex = Type.indexOf(t)
        colorIndex = Color.indexOf(c)
    }

    String toString() {
        return Type[typeIndex] + '_' + Color[colorIndex]
    }
}